package edu.niu.mcaslab;

import java.util.ArrayList;
import java.util.List;

/**
 * for describe/define a application
 */
public class AndApplication {
    private String label;
    private String name;
    private int verCode;
    private String verName;
    private int system;
    private List<Integer> permissions;

    public AndApplication(String label, String name, int verCode, String verName, int system) {
        this.label = label;
        this.name = name;
        this.verCode = verCode;
        this.verName = verName;
        this.system = system;
        permissions = new ArrayList<Integer>();
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getVerCode() {
        return verCode;
    }

    public void setVerCode(int verCode) {
        this.verCode = verCode;
    }

    public String getVerName() {
        return verName;
    }

    public void setVerName(String verName) {
        this.verName = verName;
    }

    public int isSystem() {
        return system;
    }

    public void setSystem(int system) {
        this.system = system;
    }

    public List<Integer> getPermissions() {
        return permissions;
    }

    public void addPermission(Integer permissionId) {
        if (!permissions.contains(permissionId))
            permissions.add(permissionId);
    }

}
